/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#ifndef MK_HTTP_MEDIA_SESSION_H
#define MK_HTTP_MEDIA_SESSION_H
#include "MkHttp/MkHttpSession.h"
#include "MkMedia/MkMediaUtil.h"
#include "MkMedia/MkMediaConsumer.h"

class MkApi CMkWsFlvConsume : public CMkMediaConsume
{
public:
    CMkWsFlvConsume();
    ~CMkWsFlvConsume();

    Uint32 ConsumeEsPacket(CMkMediaSource* pSource, const MkEsPacket& EsPacket, Uint8* pBuf, Uint32 nLen) override;
protected:
private:
};

class CMkHttpMediaSession : public CMkHttpSession, public CMkMediaConsumer
{
public:
    CMkHttpMediaSession(CMkEvent *pEvent, CMkTimer* pTimer, CMkHttpServer* parent);
    virtual ~CMkHttpMediaSession();

    Uint32 SendFlvStream(const MkEsPacket& EsPacket, const CMkBufferList& BufferList);
private:
    void Release() override;
private:
    MkListCacheStreamPacket m_ListCacheStream;
};


#endif


